#include "TcpServer.hpp"

#include "Command.hpp"

int main(int argc,char* argv[])
{
    CommandClass cmd;
    if (argc != 2)
    {
        std::cout << "Usage: user ./server_tcp port" << std::endl;
        return 1;
    }
    uint16_t port = std::stoi(argv[1]);
    std::shared_ptr<TcpServer> server = std::make_shared<TcpServer>(port);
    server->InitServer();
    server->RegisterHander([&cmd](std::string&s){ return cmd.CommandStr(s);});
    server->Start();

    return 0;
}
